#ifndef WXWIDGETSGUIAPPADOPTINGDLG_H
#define WXWIDGETSGUIAPPADOPTINGDLG_H

#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/listbox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include "scrollingdialog.h"
#include <wx/gauge.h>

#include <wx/timer.h>
#include <projectfile.h>

class wxWidgetsGUI;

class wxWidgetsGUIAppAdoptingDlg: public wxScrollingDialog {
  public:

    wxWidgetsGUIAppAdoptingDlg( wxWindow* parent, wxWidgetsGUI* GUI, wxWindowID id = -1 );
    virtual ~wxWidgetsGUIAppAdoptingDlg();
    static const long ID_LISTBOX1;
    static const long ID_GAUGE1;
    static const long ID_STATICTEXT1;
    static const long ID_STATICTEXT2;
    static const long ID_BUTTON5;
    static const long ID_BUTTON2;
    static const long ID_BUTTON3;
    static const long ID_STATICLINE2;
    static const long ID_BUTTON4;
    static const long ID_STATICLINE1;
    static const long ID_BUTTON6;

    wxString m_RelativeFileName;

  protected:

    void OnButton6Click( wxCommandEvent& event );
    void OnButton4Click( wxCommandEvent& event );
    void OnClose( wxCloseEvent& event );
    void OnTimer( wxTimerEvent& event );
    void OnUseFileBtnClick( wxCommandEvent& event );
    void OnSelectBtnClick( wxCommandEvent& event );
    void OnCreateBtnClick( wxCommandEvent& event );
    wxButton* Button4;
    wxButton* CreateBtn;
    wxBoxSizer* BoxSizer2;
    wxStaticLine* StaticLine2;
    wxButton* Button6;
    wxButton* SelectBtn;
    wxStaticLine* StaticLine1;
    wxButton* UseFileBtn;
    wxGauge* Progress;
    wxStaticText* ScanningFile;
    wxStaticText* ScanningTxt;
    wxListBox* FoundFiles;

  private:
    void Run();
    bool ScanFile( ProjectFile* File );
    void AddSmith( wxString RelativeFileName );

    M_Code_Project* m_Project;       ///< \brief Helper pointer to C::B project
    wxWidgetsGUI* m_GUI;        ///< \brief GUI which has requested the scan
    wxTimer m_Timer;            ///< \brief Timer used to call Run() after dialog is shown
    bool m_Run;
    DECLARE_EVENT_TABLE()
};

#endif
